package com.simple.core.util;

import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.regex.Pattern;

/**
 * @author : mocun
 * @since : 2023/3/22
 */
@Slf4j
public final class CellphoneUtil {
    private static final Pattern PATTERN_CELLPHONE = Pattern.compile("^1[3456789]\\d{9}$");


    public static boolean is(String cellphone) {
        if (StrUtil.isEmpty(cellphone)) {
            return false;
        }
        return PATTERN_CELLPHONE.matcher(cellphone).matches();
    }

    public static boolean not(String cellphone) {
        return !is(cellphone);
    }


}
